package com.moss.cloud.base.biz.controller;

import com.moss.cloud.base.api.model.param.LockPageParam;
import com.moss.cloud.base.biz.service.IAccountLockHistoryRecordService;
import com.moss.cloud.common.core.constant.ServiceList;
import com.moss.cloud.common.core.model.Result;
import com.moss.cloud.common.security.annotation.SysLog;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(ServiceList.BASE + "/accountLockHistoryRecord")
public class AccountLockHistoryRecordController {
    private final IAccountLockHistoryRecordService accountLockHistoryRecordService;

    public AccountLockHistoryRecordController(IAccountLockHistoryRecordService accountLockHistoryRecordService) {
        this.accountLockHistoryRecordService = accountLockHistoryRecordService;
    }

    /**
     * 账号锁定历史记录分页
     *
     * @param pageParam
     * @return
     */
    @PostMapping("/recordPage")
    @SysLog(serverName = ServiceList.MOSS_CLOUD_BASE, operation = "账号锁定历史记录分页")
    public Result<?> recordPage(@RequestBody @Validated LockPageParam pageParam){
        return Result.success(accountLockHistoryRecordService.recordPage(pageParam));
    }
}
